# - Try to find ISE 
# Once done, it will define
#
# ISE_FOUND - system has ISE
# ISE_INCLUDE_DIRS - ISE include directories
# ISE_DEFINITIONS - Compiler switches required for using ISE
# ISE_LIBRARIES - link these to use ISE

#include(LibFindMacros)


FIND_PACKAGE(iulib REQUIRED)


IF (OCRopus_INCLUDE_DIRS AND OCRopus_LIBRARIES)
   # in cache already
   SET(OCRopus_FIND_QUIETLY TRUE)
ENDIF (OCRopus_INCLUDE_DIRS AND OCRopus_LIBRARIES)



# Include dir
find_path(OCRopus_INCLUDE_DIR
  NAMES ocropus/ocropus.h
  PATHS ${OCRopus_PKGCONF_INCLUDE_DIRS})

# Library
find_library(OCRopus_LIBRARY
  NAMES ocropus
  PATHS ${OCRopus_PKGCONF_LIBRARY_DIRS})


#set(ISE_PROCESS_INCLUDES ISE_INCLUDE_DIR)
#set(ISE_PROCESS_LIBS ISE_LIBRARY)
#libfind_process(ISE)


INCLUDE(FindPackageHandleStandardArgs)

# handle the QUIETLY and REQUIRED arguments and set ISE_FOUND to TRUE if 
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OCRopus DEFAULT_MSG OCRopus_LIBRARY OCRopus_INCLUDE_DIR)

IF (ISE_FOUND)
  set(OCRopus_INCLUDE_DIRS ${iulib_INCLUDE_DIRS} ${OCRopus_INCLUDE_DIR})
  set(OCRopus_LIBRARIES ${iulib_LIBRARIES} ${OCRopus_LIBRARY})
ENDIF (ISE_FOUND)


MARK_AS_ADVANCED(OCRopus_INCLUDE_DIRS OCRopus_LIBRARIES)

